package cn.tworice.cryption.service.impl;

import cn.tworice.cryption.service.CryptService;

import java.util.Base64;

public class Base64ServiceImpl implements CryptService {
    @Override
    public String encrypt(String input) {
        return Base64.getEncoder().encodeToString(input.getBytes());
    }

    @Override
    public String decrypt(String input) {
        return new String(Base64.getDecoder().decode(input));
    }
}
